﻿<Window x:Class="Alma.Core.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:UX="clr-namespace:Alma.UX;assembly=Alma.UX"
        xmlns:properties="clr-namespace:Alma.Core.Properties"
        xmlns:Converters="clr-namespace:Alma.Converters;assembly=Alma.Converters"
        Title="alma" Style="{DynamicResource style_main_window}" >
    <Window.Resources>
        <Converters:ListItemTagToUriConverter x:Key="ListItemTagToUriConverter"/>
        <Converters:BooleanToHiddenOrVisibleConverter x:Key="BooleanToHiddenOrVisibleConverter"/>
        <Converters:BorderClipConverter x:Key="ContentClipConverter"/>
        
        <Style TargetType="Window" x:Key="style_main_window">
            <Setter Property="AllowsTransparency" Value="True"/>
            <Setter Property="WindowStyle" Value="None"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Width" Value="1000"/>
            <Setter Property="Height" Value="600"/>
            <Setter Property="Icon" Value="Alma.ico"/>
            <Setter Property="Top" Value="{Binding Path=WindowTop,Source={x:Static properties:Settings.Default}, Mode=TwoWay}"/>
            <Setter Property="Left" Value="{Binding Path=WindowLeft,Source={x:Static properties:Settings.Default}, Mode=TwoWay}"/>
        </Style>
        <Style x:Key="style_background_border" TargetType="Border">
            <Setter Property="Margin" Value="0,0,0,20"/>
            <Setter Property="CornerRadius" Value="5"/>
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush ImageSource="/Alma.Assets;Component/Images/MainBackgroundTexture.png" TileMode="Tile" Stretch="UniformToFill" ViewportUnits="Absolute" Viewport="0,0,100,100"/>
                </Setter.Value>
            </Setter>
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect Color="Black" BlurRadius="10" ShadowDepth="0"/>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="ListBoxItem" x:Key="style_navi_item_style">
            <Setter Property="Foreground" Value="LightGray"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                        <Grid Height="54" Width="245">
                            <Border Background="White" Opacity="0"/>
                            <Image Source="/Alma.Assets;Component/Images/ModulesListSelection.png" Visibility="{Binding IsSelected, Converter={StaticResource BooleanToHiddenOrVisibleConverter}, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <ContentPresenter ContentSource="Content" VerticalAlignment="Center" Margin="10" HorizontalAlignment="Stretch" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="ListBox" x:Key="style_navi_box">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
            <Setter Property="BorderThickness" Value="0"/>
        </Style>
    </Window.Resources>
    
    <Grid Margin="10" MouseLeftButtonDown="MoveWindow">
        <Border Style="{DynamicResource style_background_border}" />
        <!---->
        <Grid Margin="0,0,0,20">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition />
                <RowDefinition Height="auto"/>
                <RowDefinition Height="55"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="240"/>
                <ColumnDefinition />
                <ColumnDefinition Width="240"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3" CornerRadius="5,5,0,0">
                <Border.Background>
                    <ImageBrush ImageSource="/Alma.Assets;Component/Images/TitleBarBGLeft.png" TileMode="Tile" Stretch="Uniform" ViewportUnits="Absolute" Viewport="0,0,25,42"/>
                </Border.Background>
            </Border>
            <Grid VerticalAlignment="Center" Margin="8,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <UX:UXCloseBox Click="CloseWindow"/>
                    <UX:UXMinimizeBox Click="MiniWindow"/>
                    <UX:UXMaximizeBox Click="MaxWindow"/>
                </StackPanel>

                <TextBlock Text="alma" VerticalAlignment="Center" Foreground="LightGray" FontSize="24" Grid.Column="1" HorizontalAlignment="Right" FontFamily="Segoe WP">
                    <TextBlock.Effect>
                        <DropShadowEffect ShadowDepth="0" BlurRadius="8"/>
                    </TextBlock.Effect>
                </TextBlock>
            </Grid>
            
            <ListBox Style="{DynamicResource style_navi_box}" Grid.Row="1" Name="naviList" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                <UX:ListBoxItemWithIcon Icon="/Alma.Assets;Component/Images/ModuleIconSmartCleanup_Small.tiff" Content="home" Uri="/Views/HomeView.xaml"/>
                <UX:ListBoxItemWithIcon Icon="/Alma.Assets;Component/Images/ModuleIconiPhoto_Small.tiff" Content="profiles" Uri="/Views/ProfileView.xaml"/>
                <UX:ListBoxItemWithIcon Icon="/Alma.Assets;Component/Images/ModuleIconApplications_Small.tiff" Content="preferences"/>
                <UX:ListBoxItemWithIcon Icon="/Alma.Assets;Component/Images/ModuleIconLargeOld_Small.tiff" Content="Templates" Visibility="Collapsed"/>
                <UX:ListBoxItemWithIcon Icon="/Alma.Assets;Component/Images/ModuleIconExtensions_Small.tiff" Content="about" Uri="/Views/AboutView.xaml"/>
            </ListBox>

            <Grid Grid.Row="2" Background="White" Margin="10">
                
            </Grid>

            <UX:UXSeparatorHorizontal Grid.Row="3" VerticalAlignment="Top"/>
        </Grid>
        <!---->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="240"/>
                <ColumnDefinition />
                <ColumnDefinition Width="240"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.ColumnSpan="2" Grid.Column="1">
                <UX:UXBackgrid/>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="100"/>
                    </Grid.RowDefinitions>
                    <Frame NavigationUIVisibility="Hidden" Source="{Binding SelectedItem.Uri, ElementName=naviList}"/>
                    <UX:UXTurbine Grid.Row="1"/>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</Window>
